package runInfo;

import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;

public class GuiTest {

	private Shell sShell = null;  //  @jve:decl-index=0:visual-constraint="10,10"
	private Group group = null;
	private Button button = null;
	private Button checkBox = null;
	private Button button1 = null;

	/**
	 * This method initializes group	
	 *
	 */
	private void createGroup() {
		GridLayout gridLayout1 = new GridLayout();
		gridLayout1.numColumns = 2;
		GridData gridData = new GridData();
		gridData.horizontalSpan = 2;
		group = new Group(sShell, SWT.NONE);
		group.setText("Group 1");
		group.setLayoutData(gridData);
		group.setLayout(gridLayout1);
		button = new Button(group, SWT.NONE);
		button.setText("button 1");
		checkBox = new Button(group, SWT.CHECK);
		checkBox.setText("check box 1");
		button1 = new Button(group, SWT.NONE);
		button1.setText("button 2");
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		/* Before this is run, be sure to set up the launch configuration (Arguments->VM Arguments)
		 * for the correct SWT library path in order to run with the SWT dlls. 
		 * The dlls are located in the SWT plugin jar.  
		 * For example, on Windows the Eclipse SWT 3.1 plugin jar is:
		 *       installation_directory\plugins\org.eclipse.swt.win32_3.1.0.jar
		 */
		Display display = Display.getDefault();
		GuiTest thisClass = new GuiTest();
		thisClass.createSShell();
		thisClass.sShell.open();

		while (!thisClass.sShell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}

	/**
	 * This method initializes sShell
	 */
	private void createSShell() {
		GridLayout gridLayout = new GridLayout();
		gridLayout.numColumns = 2;
		sShell = new Shell();
		sShell.setText("test gui");
		createGroup();
		sShell.setLayout(gridLayout);
		sShell.setSize(new Point(601, 416));
	}

}
